<?php
$this->headLink()->appendStylesheet($this->js('css/jquery.alerts.css'))
->appendStylesheet($this->Css('table.css'));
$this->headStyle()->captureStart()?>
.newspaper-a {font-size:100%;margin:5px; white-space: nowrap; float:left; width:300px;text-align:center}
<?php $this->headStyle()->captureEnd()?>
<div style="float:left">
<table class="newspaper-a" border="1" >
<thead>
<tr>
<th><?php echo $this->translate('grade class')?></th>
<th><?php echo $this->translate('boy')?></th>
<th><?php echo $this->translate('girl')?></th>
<th><?php echo $this->translate('count')?></th>
</tr>
</thead>
<tbody>
<?php foreach($this->className as $id=>$className):?>
<tr>
<td><?php echo $className?></td>
<td><?php echo $this->data[$id]['M']?></td>
<td><?php echo $this->data[$id]['F']?></td>
<td><?php echo $this->data[$id]['M']+$this->data[$id]['F']?></td>
</tr>
<?php endforeach?>
</tbody>
</table>
</div>

<div style="float:left">
<table class="newspaper-a"  border="1">
<thead>
<tr>
<th><?php echo $this->translate('grade')?></th>
<th><?php echo $this->translate('class count')?></th>
<th><?php echo $this->translate('boy')?></th>
<th><?php echo $this->translate('girl')?></th>
<th><?php echo $this->translate('count')?></th>
</tr>
</thead>
<tbody>
<?php $a=0;$b=0;$c=0;?>
<?php foreach($this->ClassGrade() as $id=>$gradeName):?>
<tr>
<td><?php echo $gradeName?></td>
<td><?php echo count($this->gradeData[$id]['class'])?></td>
<td><?php echo $this->gradeData[$id]['M']?></td>
<td><?php echo $this->gradeData[$id]['F']?></td>
<td><?php echo $this->gradeData[$id]['M']+$this->gradeData[$id]['F']?></td>
<?php $a += count($this->gradeData[$id]['class']); ?>
<?php $b += $this->gradeData[$id]['M']?>
<?php $c += $this->gradeData[$id]['F']?>
</tr>
<?php endforeach?>
<tr>
<td><?php echo $this->translate('count')?></td>
<td><?php echo $a?></td>
<td><?php echo $b?></td>
<td><?php echo $c?></td>
<td><?php echo $b+$c?></td>
</tr>
</tbody>
</table>
<?php if ($this->homeSchooling):?>
<div style="padding:5px">
<span><?php echo sprintf($this->translate('%d students of homeschooling included'),count($this->homeSchooling))?></span>
<ul>
<?php foreach($this->homeSchooling as $row):?>
<li><?php echo $this->className[$row['grade'].'-'.$row['class_sn']]?>
(<?php echo $row['number']?>) <?php echo $row['name']?>
(<?php if($row['sex']=='M'):?><?php echo $this->translate('boy')?><?php else:?><?php $this->translate('girl')?><?php endif?>)
  </li>
<?php endforeach?>
</ul>
</div>
<?php endif?>
</div>
<div style="clear:both"></div>